package com.pro.controller;

import com.pro.pojo.JsLog;
import com.pro.pojo.JsonData;
import com.pro.service.JsLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author 祖铭泽
 * @Date 2022/1/14/0014
 * @description 日志 实现类
 */
@RequestMapping(value = "/log")
@Controller
public class JsLogController  {
    @Autowired
    private JsLogService jsLogService;

    /**
     * @Author 祖铭泽
     * @Date 2022/1/14/0014
     * @description 添加日志
     */
    @ResponseBody
    @RequestMapping(value = "/addLog")
    public JsonData addLog(JsLog jsLog){
        return jsLogService.addLog(jsLog);
    }
    /**
     * @Author 祖铭泽
     * @Date 2022/1/14/0014
     * @description 根据分类类型、分类备注、操作时间、创建人查询日志
     */
    @ResponseBody
    @RequestMapping(value = "/getCourseLogs")
    public JsonData getCourseLogs(JsLog jsLog) {
        return jsLogService.getCourseLogs(jsLog);
    }
    /**
     * @Author 祖铭泽
     * @Date 2022/1/14/0014
     * @description 根据日志id删除日志
     */
    @ResponseBody
    @RequestMapping(value = "/deleteLog")
    public JsonData deleteLog(Integer logId) {
        return jsLogService.deleteLog(logId);
    }
}
